# Docker image for springboot file run
# VERSION 0.0.1
# Author yzh
# 基础镜像使用java
#FROM java:openjdk-8-jre-alpine
FROM tomcat
# 作者
MAINTAINER yzh yinzhaohui@126.com
# VOLUME 指定了临时文件目录为tmp。
# 其效果是在主机 varlibdocker 目录下创建了一个临时文件，并链接到容器的tmp
RUN echo "Asia/shanghai" > /etc/timezone
VOLUME tmp
# 将jar包添加到容器中
WORKDIR /ucs-apps/
ADD target/ucs-admin.jar /ucs-apps/lib/ucs-admin.jar
ADD target/ucs-auth.jar /ucs-apps/lib/ucs-auth.jar
ADD target/ucs-desk.jar /ucs-apps/lib/ucs-desk.jar
#ADD target/ucs-develop.jar /ucs-apps/lib/ucs-develop.jar
ADD target/ucs-enterprise.jar /ucs-apps/lib/ucs-enterprise.jar
ADD target/ucs-gateway.jar /ucs-apps/lib/ucs-gateway.jar
ADD target/ucs-log.jar /ucs-apps/lib/ucs-log.jar
#ADD target/ucs-message.jar /ucs-apps/lib/ucs-message.jar
ADD target/ucs-resource.jar /ucs-apps/lib/ucs-resource.jar
ADD target/ucs-system.jar /ucs-apps/lib/ucs-system.jar
ADD target/ucs-user.jar /ucs-apps/lib/ucs-user.jar

ADD startApp.sh /ucs-apps/
RUN chmod +x /ucs-apps/startApp.sh
#RUN chkconfig --add /ucs-apps/startUcs.sh\
#    &&chkconfig /ucs-apps/startUcs.sh on
ENTRYPOINT ["/ucs-apps/startApp.sh"]
# 运行ucs服务
#ENTRYPOINT ["/opt/jdk/bin/java -version"]
